cmake_minimum_required(VERSION 3.20)

project(cpp-ded)

set(CMAKE_CXX_STANDARD 17)

file(GLOB CPPSOURCEFILE
    src/*.cpp
    include/*.h
    include/*.hpp
)

file(GLOB DLLFILES
    3rd/glew-2.2.0-win32/glew-2.2.0/bin/Release/x64/glew32.dll
    3rd/SDL2-devel-2.30.4-VC/SDL2-2.30.4/lib/x64/SDL2.dll
)

add_executable(
    ${PROJECT_NAME}
    ${CPPSOURCEFILE}
)

target_include_directories(
    ${PROJECT_NAME}
    PUBLIC
    include
    3rd/freetype-VER-2-13-2/freetype-VER-2-13-2/include
    3rd/SDL2-devel-2.30.4-VC/SDL2-2.30.4/include
    3rd/glew-2.2.0-win32/glew-2.2.0/include
)

target_link_directories(
    ${PROJECT_NAME}
    PUBLIC
    # force using x64 lib?
    3rd/SDL2-devel-2.30.4-VC/SDL2-2.30.4/lib/x64
    3rd/freetype-VER-2-13-2/freetype-VER-2-13-2/lib
    3rd/glew-2.2.0-win32/glew-2.2.0/lib/Release/x64
    # this is x86 arch type
    3rd/opengl
)

target_link_libraries(
    ${PROJECT_NAME}
    PUBLIC
    freetyped.lib
    SDL2.lib
    SDL2main.lib
    glew32s.lib
    OpenGL32.lib
)

# 忽略msvc linker警告
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/ignore:4099 /ignore:4098 ")

add_compile_options(/Zc:strictStrings-)

file(COPY ${DLLFILES} DESTINATION 
    ./Debug
)